lib/commit: Fix min-free-space accounting for reflinked content objects
When writing a content object,
create_regular_tmpfile_linkable_with_content() opportunistically tries
FICLONE to reflink data from the input fd. The reflinked file shares its
data blocks via copy-on-write, so the actual disk cost is just metadata.
However, the min-free-space accounting in write_content_object()
reserves the full file size in max_blocks upfront and never credits it
back after a successful reflink. Over many files this causes max_blocks
to diverge significantly from actual free space.
Propagate the reflink status from
create_regular_tmpfile_linkable_with_content back to
write_content_object so it can credit back the reserved blocks,
following the same pattern used for duplicate objects in
16e537cb
("lib/commit: Fix min-free-space accounting for duplicate content
objects").
This should fix the CI issues in
https://github.com/coreos/fedora-coreos-config/pull/4265.
Heavily AI-guided investigation and resolution and red-green testing.
Assisted-by: AI